package com.task.common.enums;


public enum MissionPageStatusEnum
{

    GOOD("1", "good"), WARN("2", "warn"), BAD("3", "bad");

    private final String code;
    private final String info;

    MissionPageStatusEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    /**
     * 判断传入的参数是否在枚举中
     *
     * @param info 要判断的值
     * @return 如果值在枚举中，返回 true；否则返回 false
     */
    public static boolean isValidInfo(String info) {
        for (MissionPageStatusEnum status : MissionPageStatusEnum.values()) {
            if (status.getInfo().equalsIgnoreCase(info)) {
                return true;
            }
        }
        return false;
    }
}
